wsgi: always record span status code to have it available in metrics#3148
Merged
lzchen merged 7 commits intoopen-telemetry:mainfrom Jan 2, 2025
Merged
Conversation
xrmx
reviewed
Dec 24, 2024
xrmx
reviewed
Dec 24, 2024
Contributor
xrmx
left a comment
There was a problem hiding this comment.
Thanks for the PR, would it be possible to write a test?
codefromthecrypt
approved these changes
Dec 27, 2024
Contributor
codefromthecrypt
left a comment
There was a problem hiding this comment.
Looked carefully and the overhead impact should be minimal except if metrics are dropped. For example, I'm not sure if we have an api or type-check for when metrics are not in use (Noop). In this case, we are parsing strings for no reason where we weren't before. Not sure there's anything to do about that.
xrmx
approved these changes
Dec 31, 2024
emdneto
approved these changes
Jan 2, 2025
lzchen
approved these changes
Jan 2, 2025
xrmx
pushed a commit
to xrmx/opentelemetry-python-contrib
that referenced
this pull request
Jan 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The same bug reported here
The histograms records are set without status_code attribute due to the decision is based on the span
is_recordingmethod.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
python = ">=3.9,<4"
flask-restx = "1.3.0"
flask = "^3.1.0"
opentelemetry-instrumentation-flask = "^0.50b0"
opentelemetry-api = "^1.29.0"
opentelemetry-sdk = "^1.29.0"
opentelemetry-instrumentation-wsgi = "^0.50b0"
opentelemetry-semantic-conventions = "^0.50b0"
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.